/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package nodeLevelMetaModel.impl;

import nodeLevelMetaModel.BaseStationRole;
import nodeLevelMetaModel.LeaderRole;
import nodeLevelMetaModel.NodeLevelMetaModelPackage;
import nodeLevelMetaModel.OperationalTask;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Operational Task</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link nodeLevelMetaModel.impl.OperationalTaskImpl#getFunction <em>Function</em>}</li>
 *   <li>{@link nodeLevelMetaModel.impl.OperationalTaskImpl#getName10 <em>Name10</em>}</li>
 *   <li>{@link nodeLevelMetaModel.impl.OperationalTaskImpl#getName11 <em>Name11</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class OperationalTaskImpl extends EObjectImpl implements OperationalTask {
	/**
	 * The default value of the '{@link #getFunction() <em>Function</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFunction()
	 * @generated
	 * @ordered
	 */
	protected static final String FUNCTION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getFunction() <em>Function</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFunction()
	 * @generated
	 * @ordered
	 */
	protected String function = FUNCTION_EDEFAULT;

	/**
	 * The cached value of the '{@link #getName10() <em>Name10</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName10()
	 * @generated
	 * @ordered
	 */
	protected LeaderRole name10;

	/**
	 * The cached value of the '{@link #getName11() <em>Name11</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName11()
	 * @generated
	 * @ordered
	 */
	protected BaseStationRole name11;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected OperationalTaskImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return NodeLevelMetaModelPackage.Literals.OPERATIONAL_TASK;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getFunction() {
		return function;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFunction(String newFunction) {
		String oldFunction = function;
		function = newFunction;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.OPERATIONAL_TASK__FUNCTION, oldFunction, function));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LeaderRole getName10() {
		if (name10 != null && name10.eIsProxy()) {
			InternalEObject oldName10 = (InternalEObject)name10;
			name10 = (LeaderRole)eResolveProxy(oldName10);
			if (name10 != oldName10) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME10, oldName10, name10));
			}
		}
		return name10;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LeaderRole basicGetName10() {
		return name10;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName10(LeaderRole newName10) {
		LeaderRole oldName10 = name10;
		name10 = newName10;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME10, oldName10, name10));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BaseStationRole getName11() {
		if (name11 != null && name11.eIsProxy()) {
			InternalEObject oldName11 = (InternalEObject)name11;
			name11 = (BaseStationRole)eResolveProxy(oldName11);
			if (name11 != oldName11) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME11, oldName11, name11));
			}
		}
		return name11;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BaseStationRole basicGetName11() {
		return name11;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName11(BaseStationRole newName11) {
		BaseStationRole oldName11 = name11;
		name11 = newName11;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME11, oldName11, name11));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__FUNCTION:
				return getFunction();
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME10:
				if (resolve) return getName10();
				return basicGetName10();
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME11:
				if (resolve) return getName11();
				return basicGetName11();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__FUNCTION:
				setFunction((String)newValue);
				return;
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME10:
				setName10((LeaderRole)newValue);
				return;
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME11:
				setName11((BaseStationRole)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__FUNCTION:
				setFunction(FUNCTION_EDEFAULT);
				return;
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME10:
				setName10((LeaderRole)null);
				return;
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME11:
				setName11((BaseStationRole)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__FUNCTION:
				return FUNCTION_EDEFAULT == null ? function != null : !FUNCTION_EDEFAULT.equals(function);
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME10:
				return name10 != null;
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK__NAME11:
				return name11 != null;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (function: ");
		result.append(function);
		result.append(')');
		return result.toString();
	}

} //OperationalTaskImpl
